package com.zxl.designpattern.creator.singleton;

/**
 * @author zxl
 * @version 1.0
 * @description 单例测试类
 * @date 2025/6/1 13:31
 */
public class Test {

    public static void main(String[] args) {
        // 饿汉单例
        EagerSingleton instance = EagerSingleton.getInstance();
        // 饿汉单例-枚举
        EagerSingletonEnum singletonEnum = EagerSingletonEnum.INSTANCE;
        // 懒汉单例-内部类
        LazyInnerClassSingleton innerClassSingleton = LazyInnerClassSingleton.getinstance();
        // 懒汉单例-锁形式
        LazyLockSingleton lockSingleton = LazyLockSingleton.getInstance();
        // 懒汉单例-线程不安全
        LazyUnsafeSingleton unsafeSingleton = LazyUnsafeSingleton.getInstance();
    }
}
